package com.ssyt.ec.sys.entity;

import java.util.Date;

import com.ssyt.ec.common.util.DateUtil;

/**
 * 课程实体封装
 * @author LZJ
 *
 */
public class CourseEntity {

	private int id;
	private int pid;
	private int isLeaf;
	private String name;
	private int operateUserId;
	private Date operateTime;
	private int state;
	private int memo;
	//扩展字段
	private String user__name;
	private String father__name;
	
	public int getId() {
		return id;
	}
	
	public void setId(int id) {
		this.id = id;
	}
	
	public int getPid() {
		return pid;
	}
	
	public String getPidStr() {
		if (pid == 1) {
			return "全部课程";
		} else if (pid == 0) {
			return "课程管理";
		} else {
			return null;
		}
	}
	
	public void setPid(int pid) {
		this.pid = pid;
	}
	
	public int getIsLeaf() {
		return isLeaf;
	}
	
	public void setIsLeaf(int isLeaf) {
		this.isLeaf = isLeaf;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public int getOperateUserId() {
		return operateUserId;
	}
	
	public void setOperateUserId(int operateUserId) {
		this.operateUserId = operateUserId;
	}
	
	public String getOperateTime() {
		return DateUtil.format(operateTime, "yyyy-MM-dd");
	}
	
	public void setOperateTime(Date operateTime) {
		this.operateTime = operateTime;
	}
	
	public String getState() {
		if (state == 1) {
			return "open";
		} else if (state == 2) {
			return "closed";
		} else {
			return null;
		}
	}
	
	public String getStateStr() {
		if (state == 1) {
			return "有效";
		} else if (state == 2) {
			return "无效";
		} else {
			return null;
		}
	}
	
	public void setState(int state) {
		this.state = state;
	}
	
	public int getMemo() {
		return memo;
	}
	
	public void setMemo(int memo) {
		this.memo = memo;
	}
	
	public String getUser__name() {
		return user__name;
	}

	public void setUser__name(String user__name) {
		this.user__name = user__name;
	}

	public String getFather__name() {
		return father__name;
	}

	public void setFather__name(String father__name) {
		this.father__name = father__name;
	}
	
}
